<template>
	<div>
		  <el-descriptions :title="title">
		  <el-descriptions-item  v-for="(item,index) in value" :key="index" :label="item.label">
			  <el-image v-if="item.model=='image'" :src="getImageBaseUrl()+params[item.field]" style="width: 100px;height: 100px;"/>
			  <el-switch v-else-if="item.model=='switch'"  :active-value="1"
			  	:inactive-value="0" disabled v-model="params[item.field]" />
			 <span v-else  v-html=" params[item.field]"></span>
		  </el-descriptions-item>
		
		</el-descriptions>
	</div>
</template>

<script>
	import {
		getEnvs
	} from "/@/utils/envs.js"
	import {
		GLOBAL_DATA
	} from '/@/api/constant'
	import {
		ref,
		defineComponent,
		watch,
		onMounted,
		nextTick  
	} from "vue"
	export default{
		props:{
			value:{
				type:Array,
				default:()=>{return[]}
			},
			params:{
				type:Object,
				default:()=>{return{}}
			},
			title:{
				type:String,
				default:'详情'
			}
		},
		setup(){
			const getImageBaseUrl = () => {
				const {
					envStr
				} = getEnvs()
				return GLOBAL_DATA[envStr]['image-url'];
			}
			return {getImageBaseUrl}
		}
	}
</script>

<style>
</style>
